/**      
 * @file		vector_misbehave.cpp
 * @description	This example demonstrates what happens
 *				if you refer to an element in a vector
 *				that is out of the index range or out of
 *				the vector's bounds.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
#include <vector>
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {
	vector <double> doubleVector;

	for(int i = 1; i < 200; i++) {
		doubleVector.push_back(i*i);
	}

	cout.setf(ios::fixed);
	cout.setf(ios::showpoint);
	cout.precision(2);

	// Notice the unsigned int
	// the unsigned int is a type we haven't seen
	// we use the unsigned int to get rid of the warning message 
	// VS 05 gives due to the comparison i < doubleVector.size()
	// an unsigned in can contain positive integers
	for(unsigned int i = 0; i < doubleVector.size()+1; i++) {
		cout << "doubleVector[" << i << "] = " 
			<< doubleVector[i] << endl;
	}
	return 0;
}

